package com.yao.club.controller.goods;


import com.yao.club.entity.dto.MallActivity;
import com.yao.club.entity.dto.MallAd;
import com.yao.club.entity.dto.MallGroup;
import com.yao.club.entity.result.ResponseEntity;
import com.yao.club.entity.vo.MallGroupVO;
import com.yao.club.service.MallHomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(tags = "俱乐部商城-首页模块")
@RestController
@RequestMapping("/mall/mallHome")
public class MallHomeController {
    @Autowired
    private MallHomeService goodsHomeService;

    /**
     * 获得商品首页分组
     * @return
     */
    @ApiOperation(value = "商品首页分组")
    @GetMapping("/mallGroupIndexList")
    ResponseEntity<List<MallGroup>> mallGroupIndexList(){
       return goodsHomeService.mallGroupIndexList();
    }
    /**
     * 商品引导页广告
     * @return
     */
    @ApiOperation(value = "商品引导页广告")
    @GetMapping("/cmallAdInfo")
    ResponseEntity<MallAd> cmallAdInfo(){
        return goodsHomeService.cmallAdInfo();
    }
    /**
     * 悬浮广告
     * @return
     */
    @ApiOperation(value = "悬浮广告")
    @GetMapping("/cmallFloatAdInfo")
    ResponseEntity<MallAd> cmallFloatAdInfo(){
        return goodsHomeService.cmallFloatAdInfo();
    }

    /**
     * 获得商品首页轮播图广告信息
     * @return
     */
    @ApiOperation(value = "获得商品首页轮播图广告信息")
    @GetMapping("/cmallBannerInfo")
    ResponseEntity<List<MallAd>> cmallBannerInfo(){
        return goodsHomeService.getHomeBannerInfo();
    }


    /**
     * 获得商品首活动
     * @return
     */
    @ApiOperation(value = "获得首页商品活动")
    @GetMapping("/cmallConfList")
    ResponseEntity<List<MallActivity>> cmallConfList(){
        return goodsHomeService.getHomeActivityInfo();
    }

    /**
     * 获得首页分组以及商品信息
     */
    @ApiOperation(value = "首页分组及商品列表查询")
    @GetMapping("/cMallGroupList")
    ResponseEntity<List<MallGroupVO>> cMallGroupList(){
        return goodsHomeService.cMallGroupList();
    }

}
